<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>用户列表</title>
  <link rel="stylesheet" href="{{url_for('static',path='style.css')}}">
</head>

<body>
  <div class="container">
    <h1>用户列表</h1>
    <table>
      <thead>
        <tr>
          <th>用户名</th>
          <th>邮箱</th>
          <th>电话</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>

        {% for row in userlist %}
        <tr>
          <td>{{ row['username'] }}</td>
          <td>{{ row['email'] }}</td>
          <td>{{ row['phone'] }}</td>
          <td>
            <button class="delete" onclick="window.location.href='/deleteuser/{{ row['user_id'] }}'">删除</button>
            <button class="edit"  onclick="window.location.href='/updateuser/{{ row['user_id'] }}'">编辑</button>
          </td>
        </tr>
        {% endfor %}

      </tbody>
    </table>
    <button class="add" onclick="window.location.href='/adduser'">添加用户</button>
  </div>
</body>

</html>